// pages/resttList/resttList.js
const util = require('../../utils/util.js')
const app = getApp();
const cloudUrl = app.globalData.cloudUrl;

Page({

  /**
   * 页面的初始数据
   */
  data: {
    option1: [
      { text: '综合排序', value: 0 },
      { text: '评分最高', value: 1 },
      { text: '销量最高', value: 2 },
      { text: '人均最高', value: 3 },
      { text: '人均最低', value: 4 },
    ],
    option2: [
      { text: '不限', value: 'a' },
      { text: '500米以内', value: 'b' },
      { text: '1公里以内', value: 'c' },
      { text: '2公里以内', value: 'd' },
      { text: '5公里以内', value: 'e' },
    ],
    value1: 0,
    value2: 'a',

    hotPreShop:[{id:1, name:"大木山茶室(仅限食堂)", price:"5.0", oldPrice:30, sellNum:"214.4"},{id:1, name:"黄家大院景区门票", price:30, oldPrice:30, sellNum:2},{id:1, name:"松阳端午茶", price:30, oldPrice:30, sellNum:2},{id:1, name:"黄家大院景区门票2", price:30, oldPrice:30, sellNum:2},{id:1, name:"松阳端午茶", price:30, oldPrice:30, sellNum:2},{id:1, name:"松阳端午茶", price:30, oldPrice:30, sellNum:2},
    {id:1, name:"松阳端午茶", price:30, oldPrice:30, sellNum:2},{id:1, name:"松阳端午茶", price:30, oldPrice:30, sellNum:2}],
    tempArr:[],
    hotShopUrl:cloudUrl+"canyinIcon.png",
    inputTxt:""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    var str = '热门餐厅';
    if(options.type == "1"){
      str = '餐饮预定';
    }
    wx.setNavigationBarTitle({
      title: str,
    })
    console.log(options)
  },

  onItemClick(e){
    util.gotoResttPage(e);
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
    this.data.tempArr = this.data.hotPreShop.concat();
    this.setData(this.data);
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})